package cn.zpro.gen;

import cn.zpro.gen.core.Configeration;
import cn.zpro.gen.core.GenService;

/**
 * 代码生成器初始化类
 */
public class Application {

    public static void main(String[] args) throws Exception {
        Configeration configeration = new Configeration();
        GenService genService = new GenService();
        configeration.setTableName("bmpfjz_faq");/*表名称*/
        configeration.setDaoName("FaqDao");/*DAO名称*/
        configeration.setModelName("Faq");/*实体类名称*/
        configeration.setModeName("purchase");/*子模块名称*/
        configeration.setDubboServiceImplName("DubboFaqServiceImpl");/*Dubbo服务的实现类名称*/
        configeration.setDubboServiceName("DubboFaqService");/*Dubbo接口名称*/
        configeration.setPackageName("cn.bidlink.nyc.saas.demo.server");/*默认包名称*/
        configeration.setAuthor("<a href=\"mailto:guolongzhang@ebnew.com\">张国龙</a>");/*作者*/
        genService.setConfigeration(configeration);

        /*生成Mybatis代码*/
        genService.genXml("F:\\gen\\FaqMapper.xml");
        genService.genDao("F:\\gen\\FaqDao.java");
        genService.genModel("F:\\gen\\Faq.java");
        /*生成配置Mybatis-config文件*/
        genService.genSpringConfig("F:\\gen\\spring-config.xml");
        /*生成Dubbo代码和单元测试代码*/
        genService.genDubboService("F:\\gen\\DubboFaqService.java");
        genService.genDubboServiceImpl("F:\\gen\\DubboFaqServiceImpl.java");
        genService.genTestDubboService("F:\\gen\\TestDubboFaqService.java");

    }

}
